import React, { FC, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import http from '../../api/request'
const CenterRightTwo: FC = () => {
  const [data, setTwoData] = useState([])
  const { t } = useTranslation()
  useEffect(() => {
    void http.get('/wipi/api/category?articleStatus=publish').then((res) => {
      setTwoData(res.data)
      console.log(res.data)
    })
  }, [])
  return (
    <div>
        <h4>{t('tag')}</h4>
         {
            data.map((item: any, index: number) => {
              return <li key={index}>
              <div>{item.label}</div>
              <div>共计{item.articleCount}篇文章</div>
            </li>
            })
         }
    </div>
  )
}

export default CenterRightTwo
